package com.wdz.service.impl;

import com.wdz.entity.ConnectionConfig;
import com.wdz.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @Author ：Wu Dazhong
 * @Date :2019/6/15
 * @Description:测试获取配置文件属性
 */
@Service
public class HelloServiceImpl implements HelloService {

     @Autowired
     private ConnectionConfig connectionConfig;
    @Value("${connection.username}")
    private String username;
    @Value("${connection.password}")
    private String password;

    @Override
    public String find() {
        System.out.println(connectionConfig.getUsername());
        System.out.println(connectionConfig.getPassword());
        System.out.println(username);
        System.out.println(password);
        return "吴大忠";
    }
}
